home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2.sit / Raven 1.2 / Source / Foundation / OS / ZGestalt.h < prev    next >
Text File  |  1997-08-16  |  3KB  |  105 lines

  1. /*
  2.  *  File:       ZGestalt.h
  3.  *    Summary:    Provides information about the system.
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1996-1997 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):    
  10.  *
  11.  *         <4>     8/16/97    JDJ        Added hasContextMenus.
  12.  *         <3>     8/03/97    JDJ        Added hasAppearanceMgr.
  13.  *         <2>     2/28/97    JDJ        Added virtualMemIsOn.
  14.  *         <1>     1/28/96    JDJ        Created
  15.  */
  16.  
  17. #pragma once
  18.  
  19. #include <Files.h>
  20. #include <Processes.h>
  21.  
  22. #include <ZTypes.h>
  23.  
  24.  
  25. //-----------------------------------
  26. //    Types
  27. //
  28. typedef ulong Version;        // packed version number, eg 0x0753 means 7.5.3
  29.  
  30.  
  31. // ===================================================================================
  32. //    class UGestalt
  33. // ===================================================================================
  34. class UGestalt {
  35.  
  36. public:
  37.     static Version                systemVersion;
  38.     static bool                    hasSystem7;
  39.     static bool                    hasFPU;
  40.     static bool                    hasTempMem;
  41.     static bool                    hasTrueType;
  42.     static bool                    hasThreadMgr;
  43.     static bool                 hasASLM;
  44.     static bool                 hasCFM;
  45.  
  46.     static Version                soundMgrVersion;
  47.     static bool                    hasSoundMgr3;
  48.     static bool                    has16BitSound;
  49.  
  50.     static Version                quickDrawVersion;    // 32-bit QuickDraw starts with 2.0.0
  51.     static bool                    hasColorQD;
  52.     static bool                    has32BitQD;
  53.     static bool                    hasGrayishText;
  54.     
  55.     static bool                    hasAppearanceMgr;
  56.     static bool                    hasContextMenus;
  57.     
  58.     static bool                    hasDisplayMgr;
  59.     static Version                displayMgrVersion;
  60.  
  61.     static bool                    hasQuickTime; 
  62.     static Version                quickTimeVersion;
  63.     
  64.     static bool                    hasDragMgr;
  65.     static bool                    hasTranslucentDrag;
  66.  
  67.     static bool                 hasQDGXGraphics;
  68.     static bool                 hasQDGXPrinting;
  69.     
  70.     static bool                    hasQuickDraw3D;
  71.     static Version                quickDraw3DVersion;
  72.         
  73.     static Version                textEditVersion;
  74.     static Version                scriptMgrVersion;
  75.     
  76.     static ulong                logicalRAM;            // includes virtual memory
  77.     static ulong                physicalRAM;        // the real McCoy
  78.     static bool                    virtualMemIsOn;
  79.  
  80.     static FSSpec                appSpec;            // volume, dir, and name of app
  81.     static short                appResRefNum;        // applicationユs resource refNum
  82.     static ProcessSerialNumber    psn;
  83.     static ulong                sizeFlags;            // SIZE resource flags (use mode constants in Processes.h to parse these)
  84.     
  85.     static bool                    inited;
  86.     
  87.     static void         Init();
  88. };
  89.  
  90.  
  91. // ===================================================================================
  92. //    Helper Functions
  93. // ===================================================================================
  94. bool         TrapAvailable(ushort theTrap);            
  95.             // returns whether given trap is available
  96.     
  97. bool         TestGestaltMask(ulong selector, long bitmap);    
  98.             // ask Gestalt whether a feature is available
  99.                         
  100. inline bool    TestGestaltBit(ulong selector, long bitNum)        {return TestGestaltMask(selector, 1 << bitNum);}
  101.             // like TestGestaltMask(), but takes a bit number instead of a bit mask
  102.  
  103. bool        CheckCFMLink(void* fnPtr);
  104.             // return true if the CFM library function has been successfully linked
  105.